from django.db import models
# Create your models here.


class Pub(models.Model):
    name = models.CharField(primary_key=True, max_length=30)
    email = models.EmailField(max_length=255, unique=True)
    password = models.CharField(max_length=20)


class Blog(models.Model):
    name = models.ForeignKey(Pub)
    title = models.CharField(max_length=150)
    body = models.TextField()
    timestamp = models.DateTimeField()

    class Meta:
        ordering = ('-timestamp', )
